#
# simple HTML output plugin for cppanalyse
#
import sys
import shutil
import cppAnalyze

class CopyPlugin(cppAnalyze.Plugin):
        def __init__(self):
                cppAnalyze.Plugin.__init__(self)
                self.pluginName = 'simplehtml'
                self.pluginDescription = 'outputs a simple HTML report'

        def getConfigSettings(self):
                return 'destDir,string'

        def processPluginOptions(self, argv):
                if not argv:
                        print 'Invalid plugin options. Expecting --dstDir <path>.'
                        return False
                
                if '--inputFile' in argv:
                        inFileIndex = argv.index('--inputFile') + 1

                        if inFileIndex >= len(argv):
                                print 'Error: No input file was specified.'
                                return False
                        else:
                                self.inputFile = argv[inFileIndex]
                                return True

                return False

        def makeStuffGoNow(self):
                destDir = self.getSetting('destDir')

                if not destDir:
                        print 'Error: No destDir was specified in the config-file.'
                        return -1

                # use self.inputFile as input and self.destDir as output.

                print "report output"

if __name__ == '__main__':
        exit(CopyPlugin().runPlugin(sys.argv))

